Recursion Unrolling for Divide and Conquer Programs
نویسندگان
چکیده
This paper presents recursion unrolling, a technique for improving the performance of recursive computations. Conceptually, recursion unrolling inlines recursive calls to reduce control flow overhead and increase the size of the basic blocks in the computation, which in turn increases the effectiveness of standard compiler optimizations such as register allocation and instruction scheduling. We have identified two transformations that significantly improve the effectiveness of the basic recursion unrolling technique. Conditional fusion merges conditionals with identical expressions, considerably simplifying the control flow in unrolled procedures. Recursion re-rolling rolls back the recursive part of the procedure to ensure that a large unrolled base case is always executed, regardless of the input problem size. We have implemented our techniques and applied them to an important class of recursive programs, divide and conquer programs. Our experimental results show that recursion unrolling can improve the performance of our programs by a factor of between 3.6 to 10.8 depending on the combination of the program and the architecture.
منابع مشابه
Covering vs. Divide-and-Conquer for Top-Down Induction of Logic Programs
Covering and divide-and-conquer are two wellestablished search techniques for top-down in duction of propositional theories However, for top-down induction of logic programs, only covering has been formalized and used extensively In this work, the divide-and-conquer technique is formalized as well and compared to the covering technique in a logic program ming framework Covering works by repea...
متن کاملInduction of Logic Programs by Example-Guided Unfolding
Resolution has been used as a specialisation operator in several approaches to top-down induction of logic programs. This operator allows the overly general hypothesis to be used as a declarative bias that restricts not only what predicate symbols can be used in produced hypotheses, but also how the predicates can be invoked. The two main strategies for top-down induction of logic programs, Cov...
متن کاملFree Vibration Analysis of Repetitive Structures using Decomposition, and Divide-Conquer Methods
This paper consists of three sections. In the first section an efficient method is used for decomposition of the canonical matrices associated with repetitive structures. to this end, cylindrical coordinate system, as well as a special numbering scheme were employed. In the second section, divide and conquer method have been used for eigensolution of these structures, where the matrices are in ...
متن کاملOn Parity based Divide and Conquer Recursive Functions
The parity based divide and conquer recursion trees are introduced where the sizes of the tree do not grow monotonically as n grows. These non-monotonic recursive functions called fogk(n) and f̃ogk(n) are strictly less than linear, o(n) but greater than logarithm, Ω(logn). Properties of fogk(n) such as non-monotonicity, upper and lower bounds, etc. are examined and proven. These functions are us...
متن کاملTransformation of Divide & Conquer to Nested Parallel Loops
We propose a sequence of equational transformations and specializations which turns a divide-and-conquer skeleton in Haskell into a parallel loop nest in C. Our initial skeleton is often viewed as general divide-and-conquer. The specializations impose a balanced call tree, a xed degree of the problem division, and elementwise operations. Our goal is to select parallel implementations of divide-...
متن کامل